package com.mfn.sportjava.controller;

import com.mfn.sportjava.model.dto.AnalysisStyleDTO;
import com.mfn.sportjava.model.enums.AnalysisStyle;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Anyang
 * @version 1.0.0
 * @date 2025/05/12 09:05:15
 * @description
 * @className java.lang.String
 */
@RestController
@RequestMapping("/sport")
public class StyleController {
    @GetMapping("/styles")
    public ResponseEntity<List<AnalysisStyleDTO>> getAllStyles() {
        List<AnalysisStyleDTO> styleDTOs = Arrays.stream(AnalysisStyle.values())
                .map(style -> new AnalysisStyleDTO(style.name(), style.getDisplayName(), style.getRoleDescription()))
                .collect(Collectors.toList());
        return ResponseEntity.ok(styleDTOs);
    }
}
